<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <p>这才是组件嵌套</p>
    <p>我是{{msg}}</p>
    <hr>
    <son1></son1>
  </div>
  <template id="son1">
    <div class="son1">
      <p>我是子组件，而且我也有子组件——开始套娃</p>
      <son2></son2>
    </div>
  </template>
  <template id="son2">
    <div class="son2">
      <p>我是子组件的子组件</p>
    </div>
  </template>
  <script src="../vue.js"></script>
  <script>
    let vm = new Vue({
      el: '#app',
      data() {
        return {
          msg: '父组件'
        }
      },
      components: {
        'son1': {
          template: '#son1',
          components: {
            'son2': {
              template: '#son2'
            }
          }
        }
      }
    })
  </script>
</body>
</html>